<script>
	// <!--
		
	$(function(){
		/* declarisasi */
		txtubahpassword = $("#txt-ubahpassword");
		txtubahpasswordrepeat = $("#txt-ubahpasswordrepeat");
		btnSimpanubahpassword = $("#btn-simpanubahpassword");
		formubahpassword = $("#form-ubahpassword");
		
		
		/* event */
		btnSimpanubahpassword.click(function(){
			
			passwordNew = txtubahpassword.val();
			passwordRepeat = txtubahpasswordrepeat.val();
			if (passwordNew == ""){
				alert("Password tidak boleh kosong!");
			}else if(passwordNew != passwordRepeat){
				alert("Password tidak sama!");
			}else{			
				$.ajax({
					url : "c_changepassword",
					data : {task : "UBAH_PASSWORD",password : passwordNew},
					type : 'POST'
				}).done(function(response){
					if (response == "1"){
						alert("Password berhasil disimpan!");
					}
				});
			}
		});
		
		/* method started */
	});
	// -->
</script>

<form class="form-horizontal" id="form-ubahpassword" disabled=true>
	<input  name="task" value="UPDATE" placeholder="0" hidden=hidden>
	<div class="control-group">
		<label class="control-label left" for="ubahpassword">New Password</label>
		<div class="controls">
			<input type="password" id="txt-ubahpassword" name="txt-ubahpassword" class="input-control">
		</div>
	</div>
	<div class="control-group">
		<label class="control-label left" for="ubahpasswordrepeat">Repeat Password</label>
		<div class="controls">
			<input type="password" id="txt-ubahpasswordrepeat" name="txt-ubahpasswordrepeat" class="input-control">
		</div>
	</div>
	<div class="form-actions">
            <a class="button" id="btn-simpanubahpassword"><span>Simpan</span></a>
<!-- 			>Simpan</button></a> -->
	</div>
</form>